package com.zzt.mylotterykill.controller;

import com.zzt.mylotterykill.dto.BetDto;
import com.zzt.mylotterykill.entity.BetDetail;
import com.zzt.mylotterykill.service.BetDetailService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequiredArgsConstructor
public class BetController{
    private final BetDetailService betDetailService;

    /**
     * 根据游戏投注
     * @param dto
     * @return
     */
    @PostMapping("/bet/bet")
    public List<BetDetail> getBetDetails(@RequestBody BetDto dto){
        return betDetailService.getBetDetails(dto.getGame(), dto.getNum());
    }

}
